package com.yzkj.cpjxc.business.domain;

import com.yzkj.cpjxc.business.framework.common.ConstantParam;
import com.yzkj.cpjxc.business.framework.common.Constants;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.type.Alias;

import java.util.List;

/**
 * 系统用户实体类
 */
@Alias("SysUser")
public class SysUser extends CommonBean<SysUser> {

	private static final long serialVersionUID = -4743092180585415718L;

	/**
	 * 用户主键
	 */
	private String userId;

	/**
	 * 用户名
	 */
	private String username;

	/**
	 * 密码
	 */
	private String password;

	/**
	 * 用户中文名称
	 */
	private String userCnName;

	/**
	 * 手机
	 */
	private String mobile;

	/**
	 * 电话
	 */
	private String phone;

	/**
	 * 邮箱
	 */
	private String email;

	/**
	 * 地址
	 */
	private String address;

	/**
	 * 状态 1：启用   -1：停止
	 */
	private String status;

	/**
	 * 备注
	 */
	private String remark;

	/**
	 * 删除标记 1：删除   -1：不删除
	 */
	private String deleteFlag;

	/**
	 * 身份证号码
	 */
	private String idCardNo;
	
	// ==========================================================关联集合-start======================================================================

	/**
	 * 所属角色集合
	 */
	private List<SysRole> sysRoles;
	
	/**
	 * 所属部门集合
	 */
	private List<SysDept> sysDepts;

	/**
	 * 权限集合
	 */
	private List<SysAuthority> sysAuthoritys;

	public List<SysRole> getSysRoles() {
		return sysRoles;
	}

	public void setSysRoles(List<SysRole> sysRoles) {
		this.sysRoles = sysRoles;
	}

	public List<SysAuthority> getSysAuthoritys() {
		return sysAuthoritys;
	}

	public void setSysAuthoritys(List<SysAuthority> sysAuthoritys) {
		this.sysAuthoritys = sysAuthoritys;
	}

	public String getStatusName() {
		if (StringUtils.isBlank(this.status)) {
			return ConstantParam.statusMap.get(Constants.STATUS_INACTIVE);
		}
		return ConstantParam.statusMap.get(this.status);
	}
	
	// ===========================================================关联集合-end===============================================================
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getUserCnName() {
		return userCnName;
	}

	public void setUserCnName(String userCnName) {
		this.userCnName = userCnName;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getDeleteFlag() {
		return deleteFlag;
	}

	public void setDeleteFlag(String deleteFlag) {
		this.deleteFlag = deleteFlag;
	}

	public String getIdCardNo() {
		return idCardNo;
	}

	public void setIdCardNo(String idCardNo) {
		this.idCardNo = idCardNo;
	}

	@Override
	public String toString() {
		return "SysUser [userId=" + userId + ", username=" + username + ", password=" + password + ", userCnName=" + userCnName + ", mobile=" + mobile + ", phone=" + phone
				+ ", email=" + email + ", address=" + address + ", status=" + status + ", remark=" + remark + ", deleteFlag=" + deleteFlag + ", idCardNo=" + idCardNo + "]";
	}

	public List<SysDept> getSysDepts() {
		return sysDepts;
	}

	public void setSysDepts(List<SysDept> sysDepts) {
		this.sysDepts = sysDepts;
	}

}
